﻿<%@ Control Language="VB" AutoEventWireup="false" CodeFile="ShoppingCart.ascx.vb"
    Inherits="FrontEnd_Control_ShoppingCart" %>
<%@ Import Namespace="Cls_Common" %>
<asp:UpdatePanel ID="uplShoppingCart" runat="server">
    <ContentTemplate>
        <div class="categories_title_right">
            <h1>
                GIỎ HÀNG CỦA BẠN</h1>
        </div>
        <script type="text/javascript">

            function ThanhToan() {
                $("#viewCart").toggle("slow");
                $("#thanhtoan").toggle("slow");

                return false;
            }
            function updateCart() {
                var sum = $("#<% =lblTongTien.ClientID()%>").text();
                if (sum == "") {
                    sum = 0;
                };
                var txt = $("#<% =hidProductCount.ClientID() %>").val() + " sản phẩm :</span> <span>(" + sum + " đ)</span>";
                $("#GiohangTop").html(txt);

                return false;
            }
            function ajaxJquery() {
                $(function () {
                    $("#thanhtoan").toggle("fast");

                    $("#<% =btnGioHangBack.ClientID() %>").click(function () {

                        $("#viewCart").toggle("slow");
                        $("#thanhtoan").toggle("slow");
                        return false;

                    });

                });

            }               
        </script>
        <div class="bgmid_porletright">
            <div id="viewCart" style="min-height: 350px; padding-left: 10px">
                <asp:DataGrid ID="ShpCartList" runat="server" Width="98%" HorizontalAlign="Center"
                    AutoGenerateColumns="False" DataKeyField="Quantity" ShowFooter="True" Font-Size="13px"
                    CellSpacing="5" CellPadding="5" GridLines="Vertical" BorderColor="#d7d7d7" Font-Names="Arial"
                    CssClass="tablelist" BorderStyle="Solid">
                    <AlternatingItemStyle CssClass="tbl_row_alternating"></AlternatingItemStyle>
                    <ItemStyle CssClass="row1"></ItemStyle>
                    <HeaderStyle CssClass="row_title" BorderColor="#D7D7D7" BorderStyle="Solid"></HeaderStyle>
                    <FooterStyle CssClass="row1"></FooterStyle>
                    <Columns>
                        <asp:TemplateColumn>
                            <ItemTemplate>
                                <span>
                                    <%# Container.ItemIndex+1 %>
                                </span>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Mã Sản phẩm">
                            <ItemTemplate>
                                <asp:Label ID="lblProductCode" runat="server" Text='' />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Tên Sản phẩm">
                            <ItemTemplate>
                                <asp:HyperLink ID="hplTitle" runat="server" CssClass="links" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Left" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Cửa hàng" Visible="false">
                            <ItemTemplate>
                                <asp:HyperLink ID="hplStore" runat="server" />
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Đơn giá">
                            <ItemTemplate>
                                <asp:Label ID="lblPrice" runat="server">Giá</asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Số lượng">
                            <ItemTemplate>
                                <asp:TextBox CssClass="TextBox" ID="txtQuantity" runat="server" Columns="4" MaxLength="4"
                                    Text='<%# DataBinder.Eval(Container.DataItem, "Quantity") %>' Width="50px" Style="text-align: right;"
                                    meta:resourcekey="txtQuantityResource1" />
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Thành tiền">
                            <ItemTemplate>
                                <asp:Label ID="lblSumPrice" runat="server">sum</asp:Label>
                            </ItemTemplate>
                            <ItemStyle HorizontalAlign="Right" />
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateColumn>
                        <asp:TemplateColumn HeaderText="Xóa">
                            <ItemTemplate>
                                <center>
                                    <asp:CheckBox ID="Remove" runat="server" meta:resourcekey="RemoveResource1" />
                                </center>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Center" />
                        </asp:TemplateColumn>
                    </Columns>
                </asp:DataGrid>
                <div style="text-align: right; font-family: Arial; font-size: 13px; height: 40px;
                    padding-top: 5px;">
                    Tổng tiền:<asp:Label ID="lblTongTien" runat="server" CssClass="price"></asp:Label>
                    đ &nbsp;
                </div>
                <div style="text-align: center">
                    <asp:Button ID="btnCheckOut" CssClass="button-reset" runat="server" Text="Thanh toán"
                        CausesValidation="False" />
                    <asp:Button ID="btnUpdate" CssClass="button3" runat="server" Text="Cập nhật" CausesValidation="False" />
                </div>
            </div>
            <div id="thanhtoan" style="text-align: justify !important; padding-left: 10px">
                <div>
                    <div class="Note">
                        Vui lòng cung cấp đầy đủ thông tin để chúng tôi phục vụ tốt nhất cho bạn</div>
                    <div class="lblEdit">
                        <asp:Label ID="lblCustomerName_edit" runat="server" Text="Tên quí khách:" />
                    </div>
                    <div>
                        <asp:TextBox ID="txtCustomerName" CssClass="text-box" runat="server" Text="" Width="350px" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCustomerName"
                            ErrorMessage="Hãy nhập tên của bạn" SetFocusOnError="True">*</asp:RequiredFieldValidator></div>
                    <div class="lblEdit">
                        <asp:Label ID="lblCustomerAddress_edit" runat="server" Text="Địa chỉ:" />
                    </div>
                    <div>
                        <asp:TextBox ID="txtCustomerAddress" CssClass="text-box" runat="server" Text="" Width="350px" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCustomerAddress"
                            ErrorMessage="Hãy nhập địa chỉ của bạn" SetFocusOnError="True">*</asp:RequiredFieldValidator></div>
                    <div class="lblEdit">
                        <asp:Label ID="lblCustomerEmail_edit" runat="server" Text="Email:" />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtCustomerEmail"
                            ErrorMessage="Định dạng email chưa đúng" SetFocusOnError="True" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator></div>
                    <div>
                        <asp:TextBox ID="txtCustomerEmail" CssClass="text-box" runat="server" Text="" Width="350px" />
                    </div>
                    <div class="lblEdit">
                        <asp:Label ID="lblCustomerPhone_edit" runat="server" Text="Số điện thoại:" />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Hãy nhập số điện thoại"
                            SetFocusOnError="True" ControlToValidate="txtCustomerPhone">*</asp:RequiredFieldValidator></div>
                    <div>
                        <asp:TextBox ID="txtCustomerPhone" CssClass="text-box" runat="server" Text="" Width="350px" />
                    </div>
                    <div class="lblEdit">
                        <asp:Label ID="lblCustomerNote_edit" runat="server" Text="Ghi chú" />
                    </div>
                    <div>
                        <asp:TextBox ID="txtCustomerNote" CssClass="text-box" runat="server" Text="" TextMode="MultiLine"
                            Height="102px" Width="350px" />
                    </div>
                    <div style="padding-top: 5px;">
                        <asp:Button ID="btnSave" runat="server" Text="Hoàn tất" CssClass="button3" Style="float: left;" />
                        <asp:Button ID="btnGioHangBack" runat="server" Text="Quay lại" CssClass="button-reset"
                            Style="float: left;" CausesValidation="false" />
                        &nbsp;
                    </div>
                    <div style="clear: both; height: 20px;">
                    </div>
                </div>
            </div>
        </div>
        <div class="bgbottom_porletright">
        </div>
        <asp:HiddenField ID="hidProductCount" runat="server" />
    </ContentTemplate>
</asp:UpdatePanel>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
    ShowSummary="False" />
